import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/views/layout/index.vue'
import Home from '@/views/layout/home/index.vue'
const routes = [
  {
    path: '/',
    name: 'layout',
    component: Layout,
    children:[
      {
        path:'/',
        name:'home',
        component:Home
      },
      {
        path: 'product',
        name: 'product',
        // component:() => import('@/views/product/index.vue'),
        children:[{
          path: 'list',
          name: 'list',
          component:() => import('@/views/product/index.vue'),
        },{
          path: 'category',
          name: 'category',
          component:() => import('@/views/product/category.vue'),
        },

        ]
      },
      {
        path: 'product-category',
        name: 'product-category',
        component:() =>import('@/views/product/category.vue')
      },
      {
        path: 'order-list',
        name: 'order-list',
        component:() =>import('@/views/order/index.vue')
      },
      {
        path: 'order-category',
        name: 'order-category',
        component:() =>import('@/views/order/category.vue')
      },
      {
        path: 'advert-list',
        name: 'advert-list',
        component:() =>import('@/views/advert/index.vue')
      },
      {
        path: 'advert-category',
        name: 'advert-category',
        component:() =>import('@/views/advert/category.vue')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component:import('@/views/login/index.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
